package klk.shop.servlets.contentServlets;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class Main
 */

public class WelcomeMainServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private String path;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public WelcomeMainServlet() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
		path = request.getContextPath()+"/";
		
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		out.println("<div class='center_content'>");
		out.println("<div class='left_content'>");
		out.println("");
		out.println("<div class='title'><span class='title_icon'><img src='"+path+"images/bullet1.gif' alt='' title='' /></span>Featured books</div>");
		out.println("");
		out.println("<div class='feat_prod_box'>");
		out.println("");
		out.println("<div class='prod_img'><a href='details.html'><img src='"+path+"images/prod1.gif' alt='' title='' border='0' /></a></div>");
		out.println("");
		out.println("<div class='prod_det_box'>");
		out.println("<div class='box_top'></div>");
		out.println("<div class='box_center'>");
		out.println("<div class='prod_title'>Product name</div>");
		out.println("<p class='details'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.</p>");
		out.println("<a href='details.html' class='more'>- more details -</a>");
		out.println("<div class='clear'></div>");
		out.println("</div>");
		out.println("");
		out.println("<div class='box_bottom'></div>");
		out.println("</div>");
		out.println("<div class='clear'></div>");
		out.println("</div>");
		out.println("");
		out.println("");
		out.println("<div class='feat_prod_box'>");
		out.println("");
		out.println("<div class='prod_img'><a href='details.html'><img src='"+path+"images/prod2.gif' alt='' title='' border='0' /></a></div>");
		out.println("");
		out.println("<div class='prod_det_box'>");
		out.println("<div class='box_top'></div>");
		out.println("<div class='box_center'>");
		out.println("<div class='prod_title'>Product name</div>");
		out.println("<p class='details'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.</p>");
		out.println("<a href='details.html' class='more'>- more details -</a>");
		out.println("<div class='clear'></div>");
		out.println("</div>");
		out.println("");
		out.println("<div class='box_bottom'></div>");
		out.println("</div>");
		out.println("<div class='clear'></div>");
		out.println("</div>");
		out.println("");
		out.println("");
		out.println("");
		out.println(" <div class='title'><span class='title_icon'><img src='"+path+"images/bullet2.gif' alt='' title='' /></span>New books</div> ");
		out.println(" ");
		out.println(" <div class='new_products'>");
		out.println(" ");
		out.println("<div class='new_prod_box'>");
		out.println("<a href='details.html'>product name</a>");
		out.println("<div class='new_prod_bg'>");
		out.println("<span class='new_icon'><img src='"+path+"images/new_icon.gif' alt='' title='' /></span>");
		out.println("<a href='details.html'><img src='"+path+"images/thumb1.gif' alt='' title='' class='thumb' border='0' /></a>");
		out.println("</div> ");
		out.println("</div>");
		out.println("");
		out.println("<div class='new_prod_box'>");
		out.println("<a href='details.html'>product name</a>");
		out.println("<div class='new_prod_bg'>");
		out.println("<span class='new_icon'><img src='"+path+"images/new_icon.gif' alt='' title='' /></span>");
		out.println("<a href='details.html'><img src='"+path+"images/thumb2.gif' alt='' title='' class='thumb' border='0' /></a>");
		out.println("</div> ");
		out.println("</div>");
		out.println("");
		out.println("<div class='new_prod_box'>");
		out.println("<a href='details.html'>product name</a>");
		out.println("<div class='new_prod_bg'>");
		out.println("<span class='new_icon'><img src='"+path+"images/new_icon.gif' alt='' title='' /></span>");
		out.println("<a href='details.html'><img src='"+path+"images/thumb3.gif' alt='' title='' class='thumb' border='0' /></a>");
		out.println("</div> ");
		out.println("</div>");
		out.println("");
		out.println("</div> ");
		out.println("");
		out.println("");
		out.println("<div class='clear'></div>");
		out.println("</div><!--end of left content-->");

		

	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
